/*
 * @Author: 阿芙
 * @Date: 2021-06-15 21:47:14
 * @LastEditTime: 2021-08-28 21:23:10
 * @LastEditTime: 2021-06-29 20:59:50
 * @LastEditors: Please set LastEditors
 * @Description: 
 * @FilePath: /RuoLing-SQL/Index/DB.js
 */
const MYSQL = require("../lib/MYSQL.js")

/**
 * @description: 单列模式，处理
 * @param {*}
 * @return {*}
 */
class DB{
    static MY_SQL = null;

    static Config = null;
    static v = "v1.0.1";
    /**
     * @description: 注入配置
     * @param {*} config
     * @return {*}
     */    
    static SetDB_Config(config){
       
        this.Config = config;
       
        this.Init();
    };
    static Init(){

        if(this.MY_SQL == null){
       
            this.MY_SQL = new MYSQL(this.Config);
        }
        return this.MY_SQL;
    }
    /**
     * @description: 获取实例
     * @param {*}
     * @return {*}
     */    
    static GetMY_SQL(){
        return this.MY_SQL;
    }
};


module.exports = DB;


